<template>
	<view class="uni-card-header">
		<text class="uni-h5 uni-bold" :style="{color:addressCode == 2?'#2ca33b':'red'}">{{addressCode == 2?'当前位置可打卡':addressCode == 3?'外勤中':'当前位置不在范围内'}}</text>
		<text class="uni-h5 uni-bold ">{{year}}年{{month}}月{{days}}日 星期{{day}}</text>
	</view>
</template>

<script>
	export default{
		name:"clock-header",
		props:{
			addressCode:Number
		},
		data(){
			return {
				week:["日", "一", "二", "三", "四", "五", "六"],
				year:'',
				month:'',
				days:'',
				day:''
			}
		},
		created() {
			let date = new Date()
			let year = date.getFullYear()
			let month = date.getMonth() + 1
			let days = date.getDate()
			let day = date.getDay()
			this.year = year
			this.month = month
			this.days = days
			this.day = this.week[day]
		}
	}
</script>

<style lang="scss" scoped>
	
</style>
